<?php

namespace App\Http\Requests\Admin\Orderinfo;

use Illuminate\Foundation\Http\FormRequest;

class OrderinfoCreate extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * 定义表单规则
     *
     * Date: 13/04/2018
     * @author Tenny
     * @return array
     */
    public function rules()
    {
        return [
            'order_id' => 'required',
            'category_id' => 'required',
            'price' => 'required',
            'weight' => 'required',
            'volume' => 'nullable',
            'calculation' => 'required',
            'courier_money' => 'required',
            'service_money' => 'required',
            'express_money' => 'required',
            'pack_money' =>  'required',
            'platform_money' => 'required',
            'actual_weight' => 'nullable',
            'region_mark' => 'nullable',
        ];
    }

    /**
     * 定义错误响应消息
     *
     * Date: 13/04/2018
     * @author Tenny
     * @return array
     */
    public function messages()
    {
        return [
            'designation.required' => '请输入标题',
            'name.required' => '请输入文章内容',
        ];
    }
}
